package com.key.gradle.test.handler;

import java.lang.reflect.Method;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;

public class CustomAsyncUncaughtExceptionHandler implements AsyncUncaughtExceptionHandler {
	
	private static final Logger logger = LoggerFactory.getLogger(CustomAsyncUncaughtExceptionHandler.class);

	@Override
	public void handleUncaughtException(Throwable ex, Method method, Object... params) {
		logger.error("Exception message - " + ex.getMessage());
		logger.error("Method name       - " + method.getName());
        for (Object param : params) {
        	logger.error("Parameter value   - " + param);
        }
        logger.error("AsyncUncaughtException : ", ex);
	}

}
